package jam.network.message;

import jam.network.*;

/** 
 * Class to create a login action.
 */
public class ClientActionLogin extends ClientMessage {

	protected String message;

	/**
	 * Constructor, builds the string to be sent over network
	 *
	 * @param user the username entered in gui, pass the password entered in gui
	 */
	public ClientActionLogin( String user, String pass ) {
		super( NetworkController.getTransID() );
		int transID = NetworkController.getTransID();
		message = ("CA_LOGIN:" + transID + ":" + user + ":" + pass);
		NetworkController.sent.put( transID, message);
		NetworkController.setTransID();
	}

	/**
	 * toString method.
	 *
	 * @returns the message to be sent across the network
	 */
	public String toString() {
		return message;
	}

}